<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<!DOCTYPE html>
<html>
<head>
    <title>更新物流信息 （配送企业端）</title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp"%>
</head>
<body class="skin-blue sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
    </section>
    
    <section class="content">
        <div class=" box box-success ">
           
            
            <form id="form" class="form-horizontal" action="updateLogistics.html" method="post">
                <input type="hidden" id="interflowId" name="interflowId" value="${info.interflowId}" />
              
                
                <div class="box-body">
                    
                    <div class="form-group form-group-xs">
                        <label for="inputTextAlter4" class="col-sm-2 control-label">物流单号：</label>
                        <div class="col-sm-8" style="margin-top:8px;">
                             ${info.interflowId}
                        </div>
                    </div>
                    
                    <div class="form-group form-group-xs">
                        <label for="inputTextAlter4" class="col-sm-2 control-label">随货单号：</label>
                        <div class="col-sm-8">
                        
                             <c:if test="${info != null and info.withOrderId != null }">${info.withOrderId} </c:if>
                             
                             <c:if test="${info == null or info.withOrderId == null }"> 
                                <div class="col-sm-9">
                                    <input class="form-control" id="withOrderId" name="withOrderId" placeholder="随货单号" type="text" />
                                </div>
                            </c:if>
                            
                        </div>
                    </div>
                    
                    <div class="form-group form-group-xs">
                        <label for="inputTextAlter4" class="col-sm-2 control-label">出库时间：</label>
                        <div class="col-sm-8">
                        
                             <c:if test="${info != null and info.delDatetime != null }">${info.delDatetime} </c:if>
                             
                             <c:if test="${info == null or info.delDatetime == null }"> 
                                <div class="col-sm-9">
                                    <input class="form-control" type="text" id="delDatetime"  name="delDatetime"
                                    placeholder="yyyy-MM-dd HH:mm:ss" data-provide="datepicker"
                                    data-date-fmt="yyyy-MM-dd HH:mm:ss"   />
                                </div>
                            </c:if>
                            
                        </div>
                    </div>
                    
                    <div class="form-group form-group-xs">
                        <label for="inputTextAlter4" class="col-sm-2 control-label" >物流详情：</label>
                        <div class="col-sm-9">
                        
                        <c:if test="${info != null and info.interflowDetailList != null }">
                            <c:forEach items="${info.interflowDetailList}" var="interflowDetail">${interflowDetail}<br/></c:forEach>
                        </c:if>
                        
                        </div>
                    </div>
             
                    <div class="form-group form-group-xs">
                        <label for="inputTextAlter4" class="col-sm-2 control-label" >当前物流状态时间：</label>
                        <div class="col-sm-3">
                             <!-- <input id="interflowTime" class="form-control" type="text" placeholder="YYYY-MM-DD HH:mm:ss" data-provide="datepicker" data-date-format="YYYY-MM-DD HH:mm:ss" /> -->
		                        <input class="form-control" type="text" id="interflowTime"  name="interflowTime"
		                            placeholder="yyyy-MM-dd HH:mm:ss" data-provide="datepicker"
		                            data-date-fmt="yyyy-MM-dd HH:mm:ss"  />
                        </div>
                    </div>
                           
                     <div class="form-group form-group-xs">
                        <label for="inputTextAlter4" class="col-sm-2 control-label" >当前物流状态说明：</label>
                        <div class="col-sm-9">
                             <input id="interflowDetail" name="interflowDetail" class="form-control"  placeholder="当前物流说明"/>
                        </div>
                    </div>
                    
                    
                    <c:if test="${info != null }">
                             <div class="form-group form-group-xs">
                             <label for="inputTextAlter4" class="col-sm-2 control-label" >是否送达：</label>
                             <div class="col-sm-3">
                             	<input type="checkbox" name="shifou" value="1" class="shifou">是
								<input type="checkbox" name="shifou" value="0" class="shifou">否
							</div>
                             
                       <div id="songda" style="display:none;"> <label for="inputTextAlter4" class="col-sm-2 control-label" >送达时间：</label>
                        <div class="col-sm-3">
                             <!-- <input id="recpDatetime" class="form-control" type="text" placeholder="YYYY-MM-DD HH:mm:ss" data-provide="datepicker" data-date-format="YYYY-MM-DD HH:mm:ss" /> -->
		                       <input class="form-control" type="text" id="recpDatetime"  name="recpDatetime"
		                            placeholder="yyyy-MM-dd HH:mm:ss" data-provide="datepicker"
		                            data-date-fmt="yyyy-MM-dd HH:mm:ss" />
		                            
                        </div> </div>
                        <!-- <div class="col-sm-4" > <font color="red">
                        <span class="required">*</span>请在物流送达目的地后选择送达时,填写后便不可再更新物流信息
                    </font> 
                    </div> -->
                    </div>
                        </c:if>
                    
                    
                    <font color="red">
                        <span class="required">*</span>如果您对物流信息有异议请联系企业，谢谢您的使用！
                    </font>
                </div>
                 
                
                <div class="box-footer text-center">
                   <button type="button" class="btn btn-success btn-sm" onclick="updateLogistics();">确认</button>   
                </div>
            </form>
        </div>
    </section>
    
    <%@ include file="/WEB-INF/component/commonJS.jsp"%>
   <%--  <script src="${ctx}/lib/plugins/daterangepicker/moment.js"></script>
    <script src="${ctx}/lib/plugins/daterangepicker/daterangepicker.js"></script> --%>
    
    <script type="text/javascript">
	        $(".shifou").click(function(){
	        	if($(this).val()=="1"){
	        		$("#songda").show();
	        	}else{
	        		$("#songda").hide();
	        	}
	        });
        
	    //确认
         function updateLogistics() {
	    	
            $.HN.message.confirm("确定更新吗？", "提示信息", "确定").on(function(bool) {
                if (bool) {
                    $("#form").ajaxSubmit({ 
                        dataType : "json",
                        timeout: 10000,
                        success : function(result, statusText) {
                            if (result.success) {
                                $.HN.message.alert("更新成功！", "消息", "success", function() {
                                	top.mainframe.document.location = "${ctx}/orderAlready/toOrderAlready.html";
                                });
                            } else {
                                $.HN.message.alert(result.msg,  "消息", "error");
                            }
                        }
                    });
                }
            });
        }
	    
	    
     
        
        
    
    
    </script>
    
</body>
</html>
